<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>Document</title>
</head>
<body>
  <script>
    // function sum(num1, num2) {
    //   console.log( num1 + num2 )
    // }
    // sum(10, 20)
    // sum(11, 20)

    
    function getSum(start, end) {
      var result = 0
      for(var i = start; i <= end; i++) {
        result += i
      }
      console.log(result)
    }
    getSum(0, 100)
    getSum(100, 200)
  </script>
</body>
</html>